/**
 * 日历管理对象
 */
var CalendarManager = new function(){
	/**
	 * 弹出年份选择层
	 */
	this.openYearSelectLayer = function(){
		$.popopLayer({
			locker:{
				scope:'document',
				color:'#fff',
				opacity:'0.5'
			},
			popup:{
				width:'420',
				height:'260',					
				bindCss:'yes',
				wrapIframe:'no',
				options:{
					dragable:'yes',
					modal:'no',
					skin:{
						color:'#b10000',
						borer:"4",
						height:'20'
					},
					resizable:'no',
					sourceType:'ajax',//程序指定，页面的某个元素内容，代码片段url,ajax [diy,url,ajax]
					sourceValue:'/navigate/jsp?url=baiduApp/demo/pop_yearBox'
				}
			}					
		});
		
	};
	
	/**
	 * 弹出月份选择
	 */
	this.openMonthSelectLayer = function(){
		//1.获取内容
		$.get("/baiduApp/printWriteDemo",{},function(xhr){
			xhr = new Function("return " + xhr);
			xhr = xhr();
			//alert(xhr['content']);
			_openByHtml(xhr.content);
		});
	};
	
	this.openToday = function(){
		//1.获取内容
		_openByAjax("/baiduApp/openToday");
	};
	
	function _openByHtml(code){
		$.popopLayer({
			locker:{
				scope:'document',
				color:'#fff',
				opacity:'0.5'
			},
			popup:{
				width:'420',
				height:'260',					
				bindCss:'yes',
				wrapIframe:'no',
				options:{
					dragable:'yes',
					modal:'no',
					skin:{
						color:'#b10000',
						borer:"4",
						height:'20'
					},
					resizable:'no',
					sourceType:'diy',//程序指定，页面的某个元素内容，代码片段url,ajax [diy,url,ajax]
					sourceValue:code
				}
			}					
		});
	}
	
	function _openByAjax(url){
		$.popopLayer({
			locker:{
				scope:'document',
				color:'#fff',
				opacity:'0.5'
			},
			popup:{
				width:'420',
				height:'260',					
				bindCss:'yes',
				wrapIframe:'no',
				options:{
					dragable:'yes',
					modal:'no',
					skin:{
						color:'#b10000',
						borer:"4",
						height:'20'
					},
					resizable:'no',
					sourceType:'ajax',//程序指定，页面的某个元素内容，代码片段url,ajax [diy,url,ajax]
					sourceValue:url
				}
			}					
		});
	}
	
}();
var CM = CalendarManager;